1. Field of Invention
The present invention relates to a before/after specific weekday determination device, a before/after specific weekday determination computer-executable program stored on a computer readable medium, a before/after specific weekday determination method, a specific date data structure, a daylight saving time determination device, and a timepiece.
2. Description of Related Art
The Global Positioning System (GPS), which can be used to determine one's location, uses GPS satellites that orbit the Earth on known orbits with each GPS satellite having an on-board atomic clock. As a result, GPS satellites also transmit extremely accurate time information (referred to herein as GPS time or satellite time information).
Automatic correction devices that use the satellite signals transmitted from such GPS satellites to acquire positioning information and time information, determine the time zone of the current location from the acquired positioning information, and calculate and display the time at the current location are known from the literature. See, for example, Japanese Unexamined Patent Appl. Pub. JP-A-H09-297191.
More specifically, the device taught in JP-A-H09-297191 receives satellite signals and acquires the coordinates of the current location, compares these coordinates with the time zone coordinates previously stored in ROM, for example, and calculates the time difference at the current location. It then compares the coordinates with the coordinates previously stored in ROM, for example, for regions that also use daylight saving time (also known as “summer time”) to determine if the current location is in a time zone that uses daylight saving time. If daylight saving time is used, it checks if an internal calendar currently indicates a date in a daylight saving time period, and if daylight saving time is in effect calculates the time adjustment from standard time. The device then automatically adjusts the time based on the calculated time difference and the daylight saving time adjustment.
In addition to determining the time zone at the current location and automatically adjusting for the time difference, the device taught in JP-A-H09-297191 can also automatically adjust the time for daylight saving time if the daylight saving time is used at the current location and the date is within the daylight saving time period, and is therefore extremely convenient.
A problem with the device taught in JP-A-H09-297191, however, is that relies on an internal calendar to determine if daylight saving time (summer time) is in effect, and therefore cannot be used in a device that does not have an internal calendar. More particularly, small devices such as wristwatches commonly have limited memory and storage capacity, and may therefore not be able to store an internal calendar. As a result, automatically adjusting the time to also reflect daylight saving time as described above may not be possible in such small devices.
Methods of using a calculation process to determine if daylight saving time is in effect instead of using an internal calendar are also conceivable.
More specifically, the beginning and end conditions for daylight saving time are typically defined as a specific weekday, such as the n-th specific weekday (where n is an integer or 1 or more) from the beginning or end of a specific month, such as the “second Sunday in March, 0:00h” or the “last Sunday in March, 0:00h,” and the dates on which daylight saving time starts and ends change from year to year. Therefore, in order to determine if daylight saving time is currently in effect, it is necessary to determine the first Sunday of the month and determine the date of, for example, the second Sunday.
One method of calculating what day of the week a certain date falls on from the year, month, and day of the Western calendar uses Zeller's congruence as shown in equation (1).
                    h        =                              (                          q              +                              [                                                                            (                                              m                        +                        1                                            )                                        ×                    26                                    10                                ]                            +              K              +                              [                                  K                  4                                ]                            +                              [                                  J                  4                                ]                            -                              2                ⁢                J                                      )                    ⁢          mod          ⁢                                          ⁢          7                                    (        1        )            where
h: is the day of the week (0=Saturday, 1=Sunday, 2=Monday, . . . 6=Friday)
q: is the day of the month
m: is the month
J: is the century (year/100, throw away the decimal)
K: is the year of the century (year mod 100 (the remainder of year/100).
In addition, if the month of the desired day is January or February, January and February are counted as months 13 and 14 of the previous year. Note, further, that [x] denotes the maximum integer not exceeding x (less than or equal to x).
Another method that does not use Zeller's congruence calculates the number of days to the current date from a reference date for which the weekday is known, and calculates the (number of days mod 7) to get the remainder and determine the weekday.
However, in order to implement either of these methods in an electronic device such as a wristwatch that has only minimal processor capacity and does not have a multiplier/divider, multiplication and division operations must be handled by an adder/subtracter, resulting in a larger program and longer processing time. As a result, implementing the foregoing methods that use calculations to determine if daylight saving time is in effect is difficult in a wristwatch or other electronic device with little processor capacity and little capacity in the ROM that stores the programs.
This problem is not limited, however, to processes for determining if daylight saving time is in effect, and also occurs when it is necessary to compare a specific date that is identified as a specific n-th weekday (where n is an integer of 1 or more) from the beginning or end of a specific month, such as a specific date identified as the second Sunday of March or the last Sunday in October, with an evaluation date such as the current date and time, and determine if the evaluation date is before or after the specific date.